package com.xxh.myapp.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//添加资源访问路径,别忘了添加注解@Configuration！！
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Value("${xxh.imagesPath}")
    private String mImagesPath;
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/images/**").addResourceLocations(mImagesPath);

    }
}
